const data = {
  search: '',
  lastSearch: 0,
  scroll: 0,
}
const mutations = {
  SET_FILTER(state, filter) {
    state.search = filter.search
    state.lastSearch = filter.lastSearch
    state.scroll = filter.scroll
  },
  SET_FILTER_SCROLL(state, scroll) {
    state.scroll = scroll
  },
}

const actions = {
  setFilter({ commit }, filter) {
    commit('SET_FILTER', filter)
  },
  setFilterScroll({ commit }, scroll) {
    commit('SET_FILTER_SCROLL', scroll)
  },
}

export default {
  namespaced: true,
  state: data,
  mutations,
  actions,
}
